Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR optimizes config loading in the desktop UI to improve performance, particularly around dictation settings and provider configuration. The main issue being addressed appears to be excessive calls to read config values (especially secret keys from the keychain).
Changes:
- Add module-level caching for ElevenLabs API key checks to avoid redundant keychain reads
- Fix
getProviderscallback memoization in ConfigContext using a ref to prevent unnecessary recreations - Consolidate dictation settings retrieval to eliminate duplicate hook calls
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
ui/desktop/src/hooks/useWhisper.ts |
Add constant for elevenlabs provider and export dictationSettings |
ui/desktop/src/hooks/useDictationSettings.ts |
Implement module-level cache for ElevenLabs key with conditional loading |
ui/desktop/src/hooks/dictationConstants.ts |
Add DICTATION_PROVIDER_ELEVENLABS constant and isSecretKeyConfigured helper |
ui/desktop/src/components/settings/dictation/VoiceDictationToggle.tsx |
Replace string literal with constant |
ui/desktop/src/components/settings/dictation/ProviderSelector.tsx |
Replace string literals with constant |
ui/desktop/src/components/settings/dictation/ProviderInfo.tsx |
Replace string literal with constant |
ui/desktop/src/components/settings/dictation/ElevenLabsKeyInput.tsx |
Use helper function and update cache, remove debug logs |
ui/desktop/src/components/bottom_menu/BottomMenuExtensionSelection.tsx |
Add loading state to prevent button visibility flicker |
ui/desktop/src/components/ConfigContext.tsx |
Fix getProviders memoization with ref pattern |
ui/desktop/src/components/ChatInput.tsx |
Get dictationSettings from useWhisper, remove duplicate hook call |
crates/goose-server/src/routes/config_management.rs |
Add 3-second debug sleep for secret config reads (TODO comment) |
Comment on lines
225
to
229
| // TODO: Remove this - simulating slow keychain access for debugging | ||
| if query.is_secret { | ||
| tokio::time::sleep(std::time::Duration::from_secs(3)).await; | ||
| } | ||
|
|
There was a problem hiding this comment.
This debug code adds a 3-second delay to all secret config reads and should not be merged to production. Remove this entire block before merging.
Suggested change
| // TODO: Remove this - simulating slow keychain access for debugging | |
| if query.is_secret { | |
| tokio::time::sleep(std::time::Duration::from_secs(3)).await; | |
| } |
2 tasks
zanesq
approved these changes
Jan 23, 2026
Collaborator
|
Thanks! |
zanesq
added a commit
that referenced
this pull request
Jan 26, 2026
* origin/main: fix: dispatch ADD_ACTIVE_SESSION event before navigating from "View All" (#6679) Speed up Databricks provider init by removing fetch of supported models (#6616) fix: correct typos in documentation and Justfile (#6686) docs: frameDomains and baseUriDomains for mcp apps (#6684) docs: add Remotion video creation tutorial (#6675) docs: export recipe and copy yaml (#6680) Test against fastmcp (#6666) docs: mid-session changes (#6672) Fix MCP elicitation deadlock and improve UX (#6650) chore: upgrade to rmcp 0.14.0 (#6674) [docs] add MCP-UI to MCP Apps blog (#6664) ACP get working dir from args.cwd (#6653) Optimise load config in UI (#6662) # Conflicts: # ui/desktop/src/components/Layout/AppLayout.tsx
katzdave
added a commit
that referenced
this pull request
Jan 26, 2026
…o dkatz/canonical-context * 'dkatz/canonical-provider' of github.com:block/goose: (27 commits) docs: add Remotion video creation tutorial (#6675) docs: export recipe and copy yaml (#6680) Test against fastmcp (#6666) docs: mid-session changes (#6672) Fix MCP elicitation deadlock and improve UX (#6650) chore: upgrade to rmcp 0.14.0 (#6674) [docs] add MCP-UI to MCP Apps blog (#6664) ACP get working dir from args.cwd (#6653) Optimise load config in UI (#6662) Fix GCP Vertex AI global endpoint support for Gemini 3 models (#6187) fix: macOS keychain infinite prompt loop (#6620) chore: reduce duplicate or unused cargo deps (#6630) feat: codex subscription support (#6600) smoke test allow pass for flaky providers (#6638) feat: Add built-in skill for goose documentation reference (#6534) Native images (#6619) docs: ml-based prompt injection detection (#6627) Strip the audience for compacting (#6646) chore(release): release version 1.21.0 (minor) (#6634) add collapsable chat nav (#6649) ...
This was referenced Jan 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Optimise the load time when app starts or new session starts
Reduce the call to check ELEVENLAB_API_KEY exists or not. This call is expensive as takes around 3s because it checks keychain at the backend
Fix getProviders callback memoization in ConfigContext using a ref to prevent unnecessary recreations
Enhanced user experience to show the puzzle of current session extension only after the extensions are loaded.
Type of Change
AI Assistance
Testing
Manual testing by adding sleep in the
/config/readendpointBefore
https://github.com/user-attachments/assets/2818649f-fce3-48de-806f-861de3612d74
After
https://github.com/user-attachments/assets/56546fdc-c722-4d5a-a7b5-5adde2f66b19